export default {
  components: {
  },
  data() {
    return {
      vipType: 1, // 用户身份
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
    }
  },
  created() {
    this.vipType = localStorage.getItem(`vipType${localStorage.getItem('userId')}`)
  },
  methods: {
    isAgentVipType() { // 验证是否是服务商，如果不是，跳转回个人中心页面
      return new Promise((resolve) => {
        if (this.companyAuth.enableNewAreaAgent == 1) {
          var agentArr = [3, 5, 6, 7, 8]
          if (agentArr.indexOf(Number(this.vipType)) == -1) {
            this.$routerGo(this, "replace", {
              path: '/member/memberIndex'
            })
          } else {
            resolve()
          }
        } else {
          resolve()
        }
      })
    }
  },
}
